﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/OneColumn.Master" AutoEventWireup="true"
    CodeBehind="Education.aspx.cs" Inherits="SharingCenter.Web.User.CurrentProfile.Education" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    教育情况
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
<style type="text/css">
.leftpad{width:600px;}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    
    <script src="AddItem.js" type="text/javascript"></script>
    <script type="text/javascript">avlitem="教育"</script>

    <myuc:GenericTabs ID="GenericTabs1" runat="server" Section="Settings" SelectedItem="edu" />
    <h1 class="bb">
        <img src="../../Content/images/icons/pencil_16.png" alt="" />
        教育情况</h1>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:ListView ID="DataList1" runat="server" DataKeyNames="EducationId" DataSourceID="ldsEducation">
                <LayoutTemplate>
                   
                            <div runat="server" id="itemPlaceholder" />
                    </LayoutTemplate>
                <ItemTemplate>
                    <div class="fc item ctn1">
                        <div class="left leftpad">
                            <div class="ctn-p-b">
                                <b>
                                    <asp:Label ID="InstitutionNameLabel" runat="server" Text='<%# Eval("InstitutionName") %>' /></b>
                                <asp:Label CssClass="sf" ID="InstitutionCountryLabel" runat="server" Text='<%# Eval("InstitutionCountry", "({0})") %>' />
                            </div>
                            <div>
                                <asp:Label ID="StartDateLabel" runat="server" Text='<%# Eval("StartDate", "{0:yyyy年M月}") %>'></asp:Label>
                                至
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("EndDate") == null ? "今" : Eval("EndDate", "{0:yyyy年M月}") %>' />
                                |
                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("Major", "专业: {0}") %>' />
                                |
                                <asp:Label ID="Label3" runat="server" Text='<%# Eval("Degree", "学历: {0}") %>' />
                            </div>
                            <div class="litetext">
                                <asp:Label ID="Label4" runat="server" Text='<%# Eval("Comment") %>' />
                            </div>
                        </div>
                        <div class="right">
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete" CssClass="deletebutton deleteitem">删除记录</asp:LinkButton>
                        </div>
                    </div>
                </ItemTemplate>
                <EmptyDataTemplate>
                    <myuc:MessageBox runat="server" ID="MessageBox1" Text="你还没有添加教育经历，赶快添加一条吧！" />
                </EmptyDataTemplate>
                <ItemSeparatorTemplate>
                    <div class="hr1"></div>
                </ItemSeparatorTemplate>
            </asp:ListView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:LinqDataSource ID="ldsEducation" runat="server" ContextTypeName="SharingCenter.Web.Classes.scDataContext"
        TableName="Sc_Educations" Where="UserId == @UserId" EnableInsert="True" OrderBy="EndDate desc, StartDate desc"
        EnableDelete="True">
        <InsertParameters>
            <asp:ProfileParameter Name="UserId" PropertyName="UserId" />
        </InsertParameters>
        <WhereParameters>
            <asp:ProfileParameter DbType="Guid" Name="UserId" PropertyName="UserId" />
        </WhereParameters>
    </asp:LinqDataSource>
    <div class="ctn1">
        <a class="openmodalformbutton addbutton">添加记录</a>
    </div>
    <div class="dialogform" title="添加教育经历">
        <asp:FormView ID="FormView1" runat="server" DataSourceID="ldsEducation" DefaultMode="Insert"
            CellSpacing="0" CellPadding="0" GridLines="None">
            <InsertItemTemplate>
                <div class="formtable">
                    <table cellpadding='0' cellspacing='0'>
                        <tr>
                            <td class="labelgroup labelcell">
                                教育机构名称：
                            </td>
                            <td class="inputgroup">
                                <asp:TextBox ID="InstitutionNameTextBox" runat="server" Text='<%# Bind("InstitutionName") %>' />
                                <asp:RequiredFieldValidator ControlToValidate="InstitutionNameTextBox" ID="RequiredFieldValidator1"
                                    ValidationGroup="newform" runat="server" ErrorMessage="教育机构名称不能为空" Display="None" />
                                <ajaxctrltool:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator1"
                                    ID="ValidatorCalloutExtender1" runat="server">
                                </ajaxctrltool:ValidatorCalloutExtender>
                            </td>
                        </tr>
                        <tr>
                            <td class="labelcell">
                                国家/地区：
                            </td>
                            <td>
                                <asp:TextBox ID="InstitutionCountryTextBox" runat="server" Text='<%# Bind("InstitutionCountry") %>' />
                                <asp:RequiredFieldValidator ControlToValidate="InstitutionCountryTextBox" ID="RequiredFieldValidator2"
                                    ValidationGroup="newform" runat="server" ErrorMessage="国家/地区不能为空" Display="None" />
                                <ajaxctrltool:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator2"
                                    ID="ValidatorCalloutExtender2" runat="server">
                                </ajaxctrltool:ValidatorCalloutExtender>
                            </td>
                        </tr>
                        <tr>
                            <td class="labelcell">
                                起止日期：
                            </td>
                            <td id="selectarea">

                                <cc:NumericDropDownList runat="server" CssClass="startselect startyear" ID="nddStartYear" IsYearList="true" YearDifferenceForLowerBound="50"
                                    DefaultSelectedYearFromThisYear="10" SelectDefaultItem="true" />
                                年
                                <cc:NumericDropDownList runat="server" CssClass="startselect startmonth" ID="nddStartMonth" LowerBound="1" UpperBound="12" />
                                月 -
                                <cc:NumericDropDownList runat="server" CssClass="endselect endyear" ID="nddEndYear" IsYearList="true"
                                    YearDifferenceForLowerBound="50" AddEmptyValueAtFirst="true" EmptyValueItemText="至今" />
                                年
                                <cc:NumericDropDownList runat="server" CssClass="endselect endmonth" ID="nddEndMonth" LowerBound="1"
                                    UpperBound="12" AddEmptyValueAtFirst="true" EmptyValueItemText="至今" />
                                月
                            </td>
                        </tr>
                        <tr>
                            <td class="labelcell">
                                专业名称：
                            </td>
                            <td>
                                <asp:TextBox ID="MajorTextBox" runat="server" Text='<%# Bind("Major") %>' />
                                <asp:RequiredFieldValidator ControlToValidate="MajorTextBox" ID="RequiredFieldValidator3"
                                    ValidationGroup="newform" runat="server" ErrorMessage="专业名称不能为空" Display="None" />
                                <ajaxctrltool:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator3"
                                    ID="ValidatorCalloutExtender3" runat="server">
                                </ajaxctrltool:ValidatorCalloutExtender>
                            </td>
                        </tr>
                        <tr>
                            <td class="labelcell">
                                学历：
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Degree") %>' />
                                <asp:RequiredFieldValidator ControlToValidate="TextBox1" ID="RequiredFieldValidator4"
                                    ValidationGroup="newform" runat="server" ErrorMessage="学历不能为空" Display="None" />
                                <ajaxctrltool:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator4"
                                    ID="ValidatorCalloutExtender4" runat="server">
                                </ajaxctrltool:ValidatorCalloutExtender>
                            </td>
                        </tr>
                        <tr>
                            <td class="labelcell">
                                隐私设置：
                            </td>
                            <td>
                                <cc:PrivacyDropDownList ID="PrivacyDropDownList1" runat="server" Privacy='<%#Bind("Privacy") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td class="labelcell">
                                附加信息：
                            </td>
                            <td>
                                <asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine" Rows="5" Text='<%# Bind("Comment") %>' />
                            </td>
                        </tr>
                    </table>
                    <br />
                    <div class="actionarea">
                        <asp:LinkButton ID="btnSave" runat="server" CssClass="submitbutton saveitem" CommandName="Insert"
                            ValidationGroup="newform" OnLoad="btnSave_Load">保存</asp:LinkButton>
                            
                        <a class="cancelbutton closemodalformbutton">取消</a>
                        <input type="reset" class="button" style="visibility:hidden;" />
                    </div>
                </div>
            </InsertItemTemplate>
        </asp:FormView>
    </div>
</asp:Content>
